package com.pengtu.web.human;


import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import com.opensymphony.xwork2.ActionSupport;
import com.pengtu.dao.QueryFilter;
import com.pengtu.service.human.LeaveOvertimeManager;
import com.pengtu.utils.web.Struts2Utils;

public class LeaveOvertimeAction extends ActionSupport {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private LeaveOvertimeManager leaveOvertimeManager;


	public LeaveOvertimeManager getLeaveOvertimeManager() {
		return leaveOvertimeManager;
	}
	@Autowired
	public void setLeaveOvertimeManager(LeaveOvertimeManager leaveOvertimeManager) {
		this.leaveOvertimeManager = leaveOvertimeManager;
	}


	public String list() throws Exception {
		QueryFilter filter=QueryFilter.buildFromHttpRequest(Struts2Utils.getRequest());	
		Map<String, Map<String, Object>> lotMap = leaveOvertimeManager.getleaveOvertimeMap(filter);
		Struts2Utils.getRequest().setAttribute("lotMap", lotMap);
		return SUCCESS;
	}
	
	public String excelOutLeaveOvertime() throws Exception{
		//样板Excel以及文件所在路径
		QueryFilter filter=QueryFilter.buildFromHttpRequest(Struts2Utils.getRequest());
		// 页面上传过来什么参数	 
		String path = leaveOvertimeManager.exportleaveOvertime(Struts2Utils.getAppRootPath(),filter);
		// 得到什么东西 
		 Struts2Utils.sendRedirectUrl("/servlet/annex?path="+path);
		return NONE;
	
	}
	
}
